%1
y = [2,5,8]
Y = diag(y,0)
A = reshape(Y,1,9)              %对Y进行逐列扫描
%2
B = [1 2 3 3;
    2 3 5 7;
    1 3 5 7;
    3 2 3 9]
C = [1+4i 4 3 6 7;
    2 3 3 5 5;
    2 6+7i 5 3 4;
    1 8 9 5 4]

D = B*C
%3
A = [1 2 3 3;
    2 3 5 7;
    1 3 5 7;
    3 2 3 9]
B = [24 96;
    34 136;
    36 144;
    35 140]
X = linsolve(A,B)
X = A\B;
%4
M = [1 1 1 0;
    1 2 1 -1;
    2 -1 0 -3;
    3 3 5 -6]
N = [1;8;3;5]
Y = M\N         %Y = M^-1*N

%5
help sum
s=0;c = 0;
for n=1:1:10
    s=s+1/n^n;
    d(n)= 1/n^n;
end
sn = s
c = sum(d)

s=0;c = 0;
for n=1:1:50
    s=s+1/n^n;
    d(n)= 1/n^n;
end
sn = s
c = sum(d)
    